// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import Vant from 'vant';
import weui from 'weui';
import 'vant/lib/vant-css/index.css';
import './assets/iconfont/iconfont.css';

// import './rem' // 适配rem
import 'amfe-flexible/index.js'


Vue.use(weui);
//加载仓库
import store from './store';

//给每个组件添加标题
router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
})


//加载服务
import {member,order,setting,item,capital,passport} from "./index.js";
Vue.prototype.$http ={
	member,
	order,
  setting,
  item,
  capital,
  passport
};


Vue.use(Vant);
Vue.config.productionTip = false;

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
